//  Copyright (c) Microsoft Corporation.  All Rights Reserved.

using System;
using System.Collections.Generic;
using System.Text;

using System.IdentityModel.Tokens;

namespace Saml20
{
    public class Saml20AssertionKeyIdentifierClause : SecurityKeyIdentifierClause
    {
        string assertionID;

        public Saml20AssertionKeyIdentifierClause(string assertionID)
            : base(null)
        {
            this.assertionID = assertionID;
        }

        public string AssertionID
        {
            get { return this.assertionID; }
        }

        public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause)
        {
            Saml20AssertionKeyIdentifierClause that = keyIdentifierClause as Saml20AssertionKeyIdentifierClause;            

            return ReferenceEquals(this, that) || (that != null && this.Matches(this.AssertionID));
        }

        public bool Matches(string id)
        {
            return assertionID == id;
        }
    }
}
